package com.ruoyi.business.controller;

import com.ruoyi.business.service.ISysAreaService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 【请填写功能名称】Controller
 *
 * @author Tellsea
 * @date 2024-12-23
 */
@Api(tags = "【地市信息查询】Controller")
@RestController
@RequestMapping("/business/area")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class SysAreaController extends BaseController {

    private final ISysAreaService sysAreaService;

    @ApiOperation("查询【获取所有省级】列表")
    @GetMapping("/getTopArea")
    public AjaxResult getProv() {
        return AjaxResult.success("查询成功", sysAreaService.getProv());
    }


    @ApiOperation("获取【下级区域】详细信息")
    @GetMapping(value = "/getChildArea/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id) {
        return AjaxResult.success("查询成功", sysAreaService.getChildArea(id));
    }


}
